package com.vert.controller;

import com.vert.annotations.*;
import com.vert.model.UploadBody;
import com.vert.service.TestService;
import io.vertx.core.http.HttpServerRequest;

/**
 * @Classname TestController
 * @Description TODO
 * @Date 2022/5/24 15:36
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@RouteMapping("/test")
public class TestController {

  @Autowired
  private TestService testService;

  @RequestMethod("/test1")
  public String Test1(){
    String s=testService.getTest();
    return String.valueOf(s);
  }

  @RequestMethod("/test2")
  public String test2(){
    return "hellowrd";
  }

  @RequestMethod("/test3")
  public String test3(HttpServerRequest request,
                      @Param(value = "type",required = false)String type,
                      @Param("typea1")String type2){
    String str1=request.getParam("str1");
    return "这是中文"+str1+" "+type+" "+type2;
  }

  @RequestMethod("/test4")
  public String test4(){
    return "哈哈";
  }

  @PostMapping("/upload")
  public String upload(UploadBody uploadBody){
    System.out.println("haha");
    return "上传成功";
  }

  @PostMapping("/testpost")
  public String test1(){
      return "111";
  }
}
